<!--环境信息年报 RptAnnual-->
<template>
    <Layout>
        <!--<Form ref="queryForm" :model="dataToQuery" :label-width="120" style="margin-top: 10px">-->
            <!--<Row v-show="!switchFlag" class="query-form" >-->
                <!--<Col span="8">-->
                    <!--<FormItem label="企业名称：" prop="order">-->
                        <!--<cascader-dom class="query-form-el" ref='queryOrgCascader' @setOrgInfo='setQueryCompanyId' :orgTree="true"-->
                                      <!--:currentOrgId="dataToQuery.companyId" :setCurrentName="{label:dataToQuery.companyName,value:dataToQuery.companyId}"></cascader-dom>-->
                    <!--</FormItem>-->
                <!--</Col>-->
                <!--<Col span="8">-->
                    <!--<FormItem label='年度：' prop='year'>-->
                        <!--<DatePicker class="query-form-el" :clearable="false" placeholder="请选择年度" v-model='dataToQuery.yearDate' type="year"></DatePicker>-->
                    <!--</FormItem>-->
                <!--</Col>-->
                <!--<Col span="8">-->
                    <!--<Button @click="reset" class="ivu-btn-reset">重置</Button>-->
                    <!--<Button type="primary" class="ivu-btn-query" icon="md-search"  @click="query">查询</Button>-->
                <!--</Col>-->
            <!--</Row>-->
            <!--<Row class="query-form">-->
                <!--<Col span="24">-->
                <!--</Col>-->
            <!--</Row>-->
        <!--</Form>-->
        <Table ref='table' :row-class-name="rowClassName" no-data-text="没有查询到相关数据!" :loading='pageStatus.loading'
               border :columns="columns1"  :data="dataTable" show-summary>
        </Table>
        <!--<Row style="margin-right:10px;">-->
            <!--<Col span="24" >-->
                <!--<Page style="float: right" :total="pagedata.total" :page-size="pagedata.pageSize" @on-change="pageChange" @on-page-size-change="pageSizeChange" :page-size-opts="pageSizeArray" show-total show-sizer show-elevator />-->
            <!--</Col>-->
        <!--</Row>-->
    </Layout>
</template>

<script>
    import {Api} from '@/api/index.js'
    var cascaderDom = () => import('@/components/cascader-dom.vue');
    import pageCommonFunction from '@/components/pageCommonFunction.js'
    export default {
        components:{cascaderDom},
        data(){
            return {
                ...this.createCommonDataField(),
                // 列表
                columns1: [
                    {title: '序号', width: 70, fixed: 'left', align: 'center', render: this.indexColumnsRender},
                    {key: 'orgName', fixed: 'left',title: '二级集团', align: 'center', minWidth: 205,},
                ],

                tableHeight:10,
                // api
                queryUrl:Api.statisticsGasUseAccount,

            }
        },
        computed: {
            // columns1() {
            //     const columns = [...this.columns];
            //     const columns1 = []
            //     columns.forEach(item => {
            //         if (this.isResult === 'greenMine') {
            //             columns1.push(item)
            //         } else {
            //             if (item.key !== 'mineName' && item.key !== 'proCreatePlanYear' && item.key !== 'nationalCreatePlanYear') {
            //                 columns1.push(item)
            //             }
            //         }
            //     })
            //     return columns1
            // },
        },
        async mounted() {
            this.setTableHeight();
            this.query();
        },
        methods:{
            ...pageCommonFunction,
            query() {
                this.pageStatus.loading = true

                this.$http.get(this.queryUrl).then((res) => {
                    if (res.data.status === 201) {
                        this.$Message.error(res.data.msg);
                    }
                    res.data.data.title.forEach(m=>this.columns1.push(m))

                    this.dataTable = res.data.data.data;
                    this.pageStatus.loading = false
                }).catch(e => {
                    this.$Message.error("数据获取失败")
                    this.pageStatus.loading = false
                })
            },


        },
        watch:{
        },

    }
</script>

<style lang='css' scoped>
    /deep/ .ivu-table .table-summary-row {
        border-top: 1px solid #e8eaec;
        background-color: #f8f8f9;
    }

    /deep/ .ivu-table .table-summary-row td {
        border-right: 1px solid #e8eaec;
        background-color: #f8f8f9;
    }

</style>
